﻿using System;

namespace UniversalEditor.Base.MenuBarItems
{
	public class MenuListItem : MenuItemBase
	{
		private readonly string _name;
		private readonly string _icon;
		private readonly MenuItemBase[] _subItems;

		public MenuListItem(string name, string icon, MenuItemBase[] subItems)
		{
			if (string.IsNullOrEmpty(name)) 
				throw new ArgumentNullException("name");
			if (subItems == null)
				throw new ArgumentNullException("subItems");

			_name = name;
			_icon = icon;
			_subItems = subItems;
		}

		public override string Name
		{
			get { return _name; }
		}

		public override string Icon
		{
			get { return _icon; }
		}

		public MenuItemBase[] SubItems
		{
			get { return _subItems; }
		}

		public virtual bool Visible
		{
			get { return true; }
		}

		public override string ToString()
		{
			return string.Format("{0}, Subitems {1}", _name, _subItems.Length);
		}
	}
}
